From 7a52b5c131faa242c9b37b60ef53b3a913c54520 Mon Sep 17 00:00:00 2001 From: Stefano Stabellini Date: Mon, 14 Feb 2011 16:49:03 +0000 Subject: [PATCH] libxl: implement trigger s3resume This is the equivalent of xm trigger s3resume and it is implemented the same way: using an ACPI state change. Signed-off-by: Stefano Stabellini Tested-by: Stefano Stabellini Acked-by: Ian Jackson Committed-by: Ian Jackson --- tools/libxl/libxl.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 1554d8824a..41db886bd0 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -2584,8 +2584,14 @@ static int trigger_type_from_string(char *trigger_name) int libxl_send_trigger(libxl_ctx *ctx, uint32_t domid, char *trigger_name, uint32_t vcpuid) { int rc = -1; - int trigger_type = trigger_type_from_string(trigger_name); + int trigger_type = -1; + if (!strcmp(trigger_name, "s3resume")) { + xc_set_hvm_param(ctx->xch, domid, HVM_PARAM_ACPI_S_STATE, 0); + return 0; + } + + trigger_type = trigger_type_from_string(trigger_name); if (trigger_type == -1) { LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, -1, "Invalid trigger, valid triggers are "); -- 2.30.2